package org.yefei.homeworkday20.two;

import java.util.Scanner;

public class TestCompany {

	public static void main(String[] args) {
		Company com = new Company();
		int choice = 0;
		Scanner in = new Scanner(System.in);
		while (true) {
			System.out.println("1:招新员工，2：查看员工信息，3：辞退员工，4:统计公司人数，9：退出");
			choice = in.nextInt();
			if (choice == 1) {
				Staff st = new Staff();
				System.out.println("新员工工号：");
				String cn = in.next();
				st.setwNum(cn);
				System.out.println("新员工姓名：");
				String n = in.next();
				st.setName(n);
				System.out.println("新员工年龄：");
				int a = in.nextInt();
				st.setAge(a);
				System.out.println("新员工性别：");
				String s = in.next();
				st.setSex(s);
				System.out.println("新员工职务：");
				String p = in.next();
				st.setPosition(p);
				System.out.println("新员工薪水：");
				double sala = in.nextDouble();
				st.setSalary(sala);
				com.addStaff(st);
			} else if (choice == 2) {
				com.printStaff();
			} else if (choice == 3) {
				System.out.println("辞退员工的工号：");
				String yNum = in.next();
				com.fireStaff(yNum);
			} else if (choice == 4) {
				com.cal();
			} else if (choice == 9) {
				System.out.println("退出系统！");
				break;
			} else {
				System.out.println("输入有误！重新输入：");
			}
		}
	}

}
